
const { apiPreFix } = require('../config').server
const vip = require('../controllers/vip')

module.exports = (router) => {
  /**
   * 会员卡列表
   */
  router.get(`${apiPreFix}/vip/list`, async ctx => {
    await vip.list(ctx)
  })
  /**
   * 获取会员卡创建记录
   */
  router.get(`${apiPreFix}/vip/listCreateRecord`, async ctx => {
    await vip.listCreateRecord(ctx)
  })
  /**
   * 删除创建记录
   */
  router.post(`${apiPreFix}/vip/deleteCreateRecord`, async ctx => {
    await vip.deleteCreateRecord(ctx)
  })
  /**
   * 批量创建卡密
   */
  router.get(`${apiPreFix}/vip/create`, async ctx => {
    await vip.create(ctx)
  })
   /**
   * 批量删除卡密
   */
  router.post(`${apiPreFix}/vip/delete`, async ctx => {
    await vip.delete(ctx)
  })
  /**
   * 激活卡密
   */
  router.post(`${apiPreFix}/vip/activation`, async ctx => {
    await vip.activation(ctx)
  })
  /**
   * 删除卡密
   */
  router.get(`${apiPreFix}/vip/destroy`, async ctx => {
    await vip.destroy(ctx)
  })
  /**
   * 会员卡类型列表
   */
  router.get(`${apiPreFix}/vip/listType`, async ctx => {
    await vip.listType(ctx)
  })
  /**
   * 添加会员卡类型
   */
  router.get(`${apiPreFix}/vip/addType`, async ctx => {
    await vip.addType(ctx)
  })
  /**
   * 删除会员卡类型
   */
  router.get(`${apiPreFix}/vip/deleteType`, async ctx => {
    await vip.deleteType(ctx)
  })
}